<template>
  <div class="wrapper">
    <van-cell-group v-for="(item, index) in datalist" :key="index">
    <van-cell center :title="item.vaccinename" :label="item.thedata" @click="showDetail(item.vaccinename)"  />
    </van-cell-group>
  </div>
</template>

<script lang="ts">
import axios from 'axios';
export default {

created(){
    this.getActivityData()
  },
  data(){
    return{
      vaccinename:"",
      thedata:"",
      location:"",
      vaccineno:"",
      manufacturer:"",
      addresss:"",
      responsibleperson:"",
      age:"",
      datalist:""
    }
  },
  methods:{
    getActivityData(){
    axios.get('/vaccine').then((res)=>{
      console.log(res);
      const data=res.data.result.data
      this.datalist=res.data.result.data
    })
    .catch(function(err){
      console.log(err);
    });
    },
    showDetail(vaccinename){
      console.log(vaccinename)
      this.vaccinename=vaccinename
      this.$router.push({path:"/vaccineDetail",query:{vaccinename : this.vaccinename}})
  }
  },
};

</script>
<style>
</style>